home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / wzun11sr.zip / REPLACE.C < prev    next >
C/C++ Source or Header  |  1992-01-15  |  1KB  |  52 lines

  1. #include <windows.h>    /* required for all Windows applications */
  2. #include "replace.h"
  3. #include "wizunzip.h"
  4. #include "helpids.h"
  5.  
  6. extern char szHelpFileName[];    /* name of help file                */
  7.  
  8. /****************************************************************************
  9.  
  10.     FUNCTION: Replace(HWND, unsigned, WORD, LONG)
  11.  
  12.     PURPOSE:  Processes messages for "Replace" dialog box
  13.  
  14.     MESSAGES:
  15.  
  16.     WM_INITDIALOG - initialize dialog box
  17.     WM_COMMAND    - Input received
  18.  
  19. ****************************************************************************/
  20.  
  21. BOOL FAR PASCAL Replace(HWND hDlg, unsigned message, WORD wParam, LONG lParam)
  22. {
  23. char Buffer[200];
  24.  
  25.     switch (message) {
  26.     case WM_INITDIALOG:
  27.         wsprintf(Buffer, "Replace %s ?", (LPSTR)lParam);
  28.         SetDlgItemText(hDlg, IDM_REPLACE_TEXT, (LPSTR)Buffer);
  29.         return (TRUE);
  30.  
  31.     case WM_COMMAND:
  32.         switch (wParam) {
  33.         case IDCANCEL:                /* ESC key                            */
  34.         case IDOK:                    /* Enter key                        */
  35.             EndDialog(hDlg, IDM_REPLACE_NO);
  36.             return TRUE;
  37.         case IDM_REPLACE_ALL:
  38.             MsWinDoAll = 1;            /* do all for life of this command */
  39.         case IDM_REPLACE_YES:
  40.         case IDM_REPLACE_NO:
  41.             EndDialog(hDlg, wParam);
  42.             return TRUE;
  43.          case IDM_REPLACE_HELP:
  44.             WinHelp(hDlg,szHelpFileName,HELP_CONTEXT, (DWORD)(HELPID_OVERWRITE));
  45.             return TRUE;
  46.         }
  47.     return TRUE;
  48.     }
  49.     return FALSE;
  50. }
  51.  
  52.